class User{
    constructor(name, age) {
        this.name = name
        this.age = age
    }
    eat(){
        console.log(this.name+'eating')
    }
    say(){
        console.log(this.name+ 'saying')
    }
}




class Person extends User{
    constructor(name,age,cars) {
        super(name,age);
        this.cars = cars
    }

    eat() {
        // super.eat();
        console.log('child',this.name, 'eating')
    }
    say() {
        // super.say();
        console.log('child', this.name, 'saying')
    }
}

const P1 = new Person('child', 19, 'BMW')
P1.say()
P1.eat()

